﻿<Application
    x:Class="MijnMultiOSRSSApp.WP8.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:common="clr-namespace:MijnMultiOSRSSApp.Common;assembly=MijnMultiOSRSSApp.Common"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:conv="clr-namespace:MijnMultiOSRSSApp.Common.Converters;assembly=MijnMultiOSRSSApp.Common"
    xmlns:h="clr-namespace:MijnMultiOSRSSApp.Helpers">

    <!--Application Resources-->
    <Application.Resources>
        <common:LocalizedStrings x:Key="LocalizedStrings"/>
        <common:Configuration x:Key="Configuration" />

        <conv:StringCaseConverter x:Key="StringCaseConverter" />
        <conv:BooleanNegationConverter x:Key="BooleanNegationConverter" />
        <conv:SyndicationToImageConverter x:Key="SyndicationToImageConverter" />
        <conv:HtmlToTextConverter x:Key="HtmlToTextConverter" />
        <conv:SyndicationLinksToUrlConverter x:Key="SyndicationLinksToUrlConverter" />
        <conv:StripHtmlConverter x:Key="StripHtmlConverter" />
        <conv:PublishDateConverter x:Key="PublishDateConverter" />
        <conv:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        <conv:BooleanToInverseVisibilityConverter x:Key="BooleanToInverseVisibilityConverter" />

        <h:AssemblyInformation x:Key="Assembly" />

        <Style TargetType="HyperlinkButton">
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="HyperlinkButton">
                        <Border Background="Transparent">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="TextElement"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="TextElement">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border Background="{TemplateBinding Background}" Margin="{StaticResource PhoneHorizontalMargin}" Padding="{TemplateBinding Padding}">
                                <ContentPresenter x:Name="TextElement" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Border>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService
            Launching="Application_Launching" Closing="Application_Closing"
            Activated="Application_Activated" Deactivated="Application_Deactivated"/>
    </Application.ApplicationLifetimeObjects>

</Application>